<template>
  <div class="layout">
    <div class="left">

        <el-menu
          :default-active="activeIndex"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @select="handleSelect"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          router
          >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>系统管理</span>
            </template>
              <!-- <el-menu-item  index="/system/userManager"><router-link :to="{'path':'/system/userManager'}">用户管理</router-link></el-menu-item> -->
              <!-- <el-menu-item  index='/system/postManager'><router-link :to="{'path':'/system/postManager'}">岗位管理</router-link></el-menu-item> -->
              <el-menu-item  index="/system/userManager" >用户管理1</el-menu-item>
               <el-menu-item  index='/system/postManager'>岗位管理1</el-menu-item>

          </el-submenu>
        </el-menu>
      </div>
      <div class="right">
        <router-view></router-view>
      </div>

  </div>
</template>

<script>
export default {
  name: 'HelloVue',
  data() {
    return {
      activeIndex:"/system/userManager",
      
    };
  },
  mounted() {
    this.activeIndex = this.$route.path
  },
  methods: {
    handleSelect(key, keyPath) {
        console.log(key, keyPath);
        // this.activeIndex = key;
      },
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    },
    
};
</script>

<style scoped>
/* Your styles here */
.left{
    width: 200px;
    height: 100vh;
    border: 1px red solid ;
    background-color: black;
}
.right{
    width: 100%;
    height: 100vh;
    border: 1px red solid ;
}
.layout{
    display: flex;
}
</style>